gtk: Be more careful when ignoring touch events
authorMatthias Clasen <mclasen@redhat.com>
Sun, 4 Mar 2012 16:20:02 +0000 (11:20 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 4 Mar 2012 16:24:51 +0000 (11:24 -0500)
gtk/gtkpressandhold.c

index aed0095d60edde76fb6488573441cb2ff50a35c5..cabdc342d5c5b62692bbc92fa6d34d2519767db0 100644 (file)
@@ -187,7 +187,8 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
   GtkPressAndHoldPrivate *priv = pah->priv;
 
   /* We're already tracking a different touch, ignore */
-  if (priv->sequence != NULL && priv->sequence != event->touch.sequence)
+  if ((event->type == GDK_TOUCH_BEGIN && priv->sequence != NULL) ||
+      (event->type != GDK_TOUCH_BEGIN && priv->sequence != event->touch.sequence))
     return;
 
   priv->x = event->touch.x;
@@ -198,7 +199,6 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
       priv->sequence = event->touch.sequence;
       priv->start_x = priv->x;
       priv->start_y = priv->y;
-
       priv->timeout =
           gdk_threads_add_timeout (priv->hold_time, hold_action, pah);
     }